<template>
    <div class="container">
        我是子组件
        <el-button @click="changeName" type="primary">change</el-button>
        {{ data.name }}
    </div>
</template>

<script setup>
import { onMounted, toRefs } from 'vue';
onMounted(() => {
    console.log(data, obj)
    console.log(emit);
})
const changeName = () => {
    $emits('changeData', 222)
    $emits('getData', 111)
}
const { data, obj } = defineProps(['data', 'obj'])
const $emits = defineEmits(['changeData', 'getData'])
</script>

<style lang="scss" scoped>

</style>